home *** CD-ROM | disk | FTP | other *** search
- ' **********************************************************
- ' GenerateBrowseTable
- '
- ' Generates a chart showing the amount of data and index
- ' space used.
- ' **********************************************************
-
- sub GenerateBrowseTable()
- Dim arrDbs()
- Dim iDbsMax
- Dim iDbsNum
- Dim strDbName
- Dim strDbDesc
- Dim strUniqueID
- Dim strServer
- Dim strDBMSName
- Dim strDBMSVersion
-
- Set theTable = document.all.item("browseTableTable")
- if (theTable.rows.length > 0) then
- Set theTable = nothing
- Exit Sub
- End if
- Set theTable = nothing
-
- Call findDbGuids(arrDbs)
- iDbsMax = UBound(arrDbs) - 1
- For iDbsNum = 0 to iDbsMax
- Call getDbNameDesc(strDbName, strDbDesc, arrDbs(iDbsNum))
- strUniqueID = "p" & arrDbs(iDbsNum)
- strServer = GetDBDataSource(arrDbs(iDbsNum), strDBMSName, strDBMSVersion)
- strDBName = strDBName & ", " & strServer & " [" & strDBMSName & ", " & strDBMSVersion & "]"
- Call GenerateBrowseDbRowDyn(-1, strDbName, strDbDesc, arrDbs(iDbsNum), strUniqueID)
- Next
-
- if (iDbsMax < 0) then
- browseHeader.style.display = "none"
- document.all.BrowseTable.style.display = "none"
- document.all.HorzRule.style.display = "none"
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- Call myNewRow.setAttribute("zzType", 1)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.width = "100%"
- myNewCell.vAlign = "top"
- myNewCell.innerText = GetResString(76) ' there is no metadata
- Set myNewCell = nothing
- else
- browseHeader.style.display = ""
- document.all.BrowseTable.style.display = ""
- document.all.HorzRule.style.display = ""
- end if
- end sub
-
-
- Sub GenerateBrowseDbRowDyn(iRowIndex, strDbName, strDbDesc, strDbGuid, strUniqueID)
- Dim strHTML
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- strDbName = MyHTMLEncode(strDbName)
- strDbDesc = MyHTMLEncode(strDbDesc)
-
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- Call myNewRow.setAttribute("zzType", 1)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBHighlightedTableText"
- myNewCell.width = "70%"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""10"" nowrap></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" width=""24"" nowrap><img src=""repdb.gif""></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" valign=""center"">" & strDbName & "</td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBHighlightedTableText"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" WIDTH=100% align=""left"" valign=""top"">" & strDbDesc & "</td>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewRow = nothing
- Set theTable = nothing
- End Sub
-
-
- Sub GenerateBrowseSchemaRowDyn(iRowIndex, strSchemaName, strSchemaDesc, strSchemaGuid, strUniqueID)
- Dim strHTML
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- strSchemaName = MyHTMLEncode(strSchemaName)
- strSchemaDesc = MyHTMLEncode(strSchemaDesc)
-
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- Call myNewRow.setAttribute("zzType", 2)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.width = "70%"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""35"" nowrap></td>"
- strHTML = strHTML & " <td class=""DBTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
- strHTML = strHTML & " <td class=""DBTableText"" width=""24"" nowrap><img src=""repsch.gif""></td>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"">" & strSchemaName & "</td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewCell = myNewRow.insertCell()
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <td class=""DBTableText"" WIDTH=100% align=""left"" valign=""top"">" & strSchemaDesc & "</td>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewRow = nothing
- Set theTable = nothing
- End Sub
-
-
- Sub GenerateBrowseTableRowDyn(iRowIndex, strTableName, strTableDesc, strTableGuid, strUniqueID)
- Dim strHTML
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- Dim L_packageStr
- Dim L_srcDestStr
- strTableName = MyHTMLEncode(strTableName)
- strTableDesc = MyHTMLEncode(strTableDesc)
-
- L_packageStr = GetResString(32)
- L_srcDestStr = GetResString(33)
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- Call myNewRow.setAttribute("zzType", 3)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.width = "70%"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"" border=""0"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""60"" nowrap></td>"
- strHTML = strHTML & " <td class=""DBTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
- strHTML = strHTML & " <td class=""DBTableText"" width=""24"" nowrap><img src=""reptbl.gif""></td>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowTableProp("" & strTableName & "","" & strTableGuid & "")"">" & strTableName & "</a></td>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"" align=""right"">"
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" border=""0"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"" align=""right""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowSrcTgtPackageProp("" & strTableName & " " & L_packageStr & "","" & strTableGuid & "","table")"">" & L_packageStr &"</a> <a class=""TableRowButton"" href language=""jscript"" onclick=""ShowSrcTgtMaps("" & strTableName & " " & L_srcDestStr & "","" & strTableGuid & "","table")"">" & L_srcDestStr & "</a></td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- strHTML = strHTML & " </td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <td class=""DBTableText"" WIDTH=100% align=""left"" valign=""top"">" & strTableDesc & "</td>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewRow = nothing
- Set theTable = nothing
- End Sub
-
-
- Sub GenerateBrowseColumnRowDyn(iRowIndex, strColName, strColDesc, strColumnGuid, strUniqueID)
- Dim strHTML
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- Dim L_packageStr
- Dim L_srcDestStr
- strColName = MyHTMLEncode(strColName)
- strColDesc = MyHTMLEncode(strColDesc)
-
- L_packageStr = GetResString(32)
- L_srcDestStr = GetResString(33)
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- Call myNewRow.setAttribute("zzType", 4)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.width = "70%"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""85"" nowrap></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" width=""12"" id=""" & strUniqueID & """ nowrap><a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" width=""24"" nowrap><img src=""repcol.gif""></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" valign=""center""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowColumnProp("" & strColName & "","" & strColumnGuid & "")"">" & strColName & "</a></td>"
- strHTML = strHTML & " <td class=""DBHighlightedTableText"" valign=""center"" align=""right"">"
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" border=""0"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"" align=""right""><a class=""TableRowButton"" href language=""jscript"" onclick=""ShowSrcTgtPackageProp("" & strColName & " " & L_packageStr & "","" & strColumnGuid & "","column")"">" & L_packageStr & "</a> <a class=""TableRowButton"" href language=""jscript"" onclick=""ShowSrcTgtMaps("" & strColName & " " & L_srcDestStr & "","" & strColumnGuid & "","column")"">" & L_srcDestStr & "</a></td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- strHTML = strHTML & " </td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBHighlightedTableText"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <td class=""DBTableText"" WIDTH=""100%"" align=""left"" valign=""top"">" & strColDesc & "</td>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewRow = nothing
- Set theTable = nothing
- End Sub
-
-
- Sub GenerateBrowseColumnDataRowDyn(iRowIndex, arrColDataValues, strColumnGuid)
- Dim strHTML
- Dim theTable
- Dim myNewRow
- Dim myNewCell
- arrColDataValues(3) = MyHTMLEncode(arrColDataValues(3))
- arrColDataValues(4) = MyHTMLEncode(arrColDataValues(4))
- arrColDataValues(5) = MyHTMLEncode(arrColDataValues(5))
- arrColDataValues(6) = MyHTMLEncode(arrColDataValues(6))
- arrColDataValues(7) = MyHTMLEncode(arrColDataValues(7))
-
- Set theTable = document.all.item("browseTableTable")
- Set myNewRow = theTable.insertRow(iRowIndex)
- theTable.rows(iRowIndex-1).cells(1).rowSpan = 2 ' so the description will wrap
- Call myNewRow.setAttribute("zzType", 5)
- Set myNewCell = myNewRow.insertCell()
- myNewCell.className = "DBTableText"
- myNewCell.width = "70%"
- myNewCell.vAlign = "top"
- strHTML = ""
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""110"" nowrap></td>"
- strHTML = strHTML & " <td align=""center"">"
- strHTML = strHTML & " <hr>"
- strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""25%"" class=""DBTableText"" valign=""center"">" & GetResString(34) & "</td>" 'DataType
- strHTML = strHTML & " <td width=""18%"" class=""DBTableText"" valign=""center"">" & GetResString(35) & "</td>" 'Length
- strHTML = strHTML & " <td width=""15%"" class=""DBTableText"" valign=""center"">" & GetResString(36) & "</td>" 'Scale
- strHTML = strHTML & " <td width=""22%"" class=""DBTableText"" valign=""center"">" & GetResString(37) & "</td>" 'Precision
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"">" & GetResString(38) & "</td>" 'Nulls
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " <tr>"
- strHTML = strHTML & " <td width=""25%"" class=""DBTableText"" valign=""center"">" & arrColDataValues(3) & "</td>"
- strHTML = strHTML & " <td width=""18%"" class=""DBTableText"" valign=""center"">" & arrColDataValues(4) & "</td>"
- strHTML = strHTML & " <td width=""15%"" class=""DBTableText"" valign=""center"">" & arrColDataValues(5) & "</td>"
- strHTML = strHTML & " <td width=""22%"" class=""DBTableText"" valign=""center"">" & arrColDataValues(6) & "</td>"
- strHTML = strHTML & " <td class=""DBTableText"" valign=""center"">" & arrColDataValues(7) & "</td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- strHTML = strHTML & " <hr>"
- strHTML = strHTML & " </td>"
- strHTML = strHTML & " </tr>"
- strHTML = strHTML & " </table>"
- myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- 'Set myNewCell = myNewRow.insertCell()
- 'myNewCell.vAlign = "top"
- 'strHTML = ""
- 'strHTML = strHTML & " <table frame=""void"" cellspacing=""0"" cellpadding=""0"" width=""100%"">"
- 'strHTML = strHTML & " <td class=""DBTableText"" WIDTH=100% align=""left"" valign=""top""> </td>"
- 'strHTML = strHTML & " </table>"
- 'myNewCell.innerHTML = strHTML
- Set myNewCell = nothing
- Set myNewRow = nothing
-
- Set theTable = nothing
- End Sub
-
-
- Sub BrwOpen(strUniqueID)
- Dim theItem
- Dim theParentItem
- Dim iType
- Dim iRowIndex
- Dim bRetVal
-
- if (AddToHistory(20, "", strUniqueID, "") = False) Then
- Exit Sub
- end if
- ' change the icon
- Set theItem = document.all.item(strUniqueID)
- theItem.innerHTML = "<a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwClose("" & strUniqueID & "")"">-</a>"
- 'theItem.style.cursor = "wait"
- 'theItem.children(0).style.cursor = "wait"
-
- ' find the row that contains this item. To do this go up through parentElements and find the element whos zzType attribute is set
- Do Until IsNull(theItem)
- iType = theItem.getAttribute("zzType")
- if Not IsNull(iType) then
- Exit Do
- end if
- Set theParentItem = theItem.parentElement
- Set theItem = nothing
- Set theItem = theParentItem
- Set theParentItem = nothing
- Loop
- iRowIndex = theItem.rowIndex
-
- errorspan.style.display = "none"
- ' now we can add rows depending on the type
- Select Case iType
- Case 1 bRetVal = BrwAddSchemas(iRowIndex, strUniqueID)
- Case 2 bRetVal = BrwAddTables(iRowIndex, strUniqueID)
- Case 3 bRetVal = BrwAddColumns(iRowIndex, strUniqueID)
- Case 4 bRetVal = BrwAddColumnData(iRowIndex, strUniqueID)
- Case 10 bRetVal = BrwAddVersions(iRowIndex, strUniqueID)
- Case 11 bRetVal = BrwAddLineages(iRowIndex, strUniqueID)
- End Select
- if bRetVal = "false" then
- Set theItem = document.all.item(strUniqueID)
- theItem.innerHTML = "<a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a>"
- end if
- Set theItem = nothing
- End Sub
-
-
- Sub BrwClose(strUniqueID)
- Dim theItem
- Dim theTable
- Dim theParentItem
- Dim iType
- Dim iType2
- Dim iRowIndex
- Dim iNum
- Dim iMax
-
- if (AddToHistory(21, "", strUniqueID, "") = False) Then
- Exit Sub
- end if
- ' change the icon
- Set theItem = document.all.item(strUniqueID)
- theItem.innerHTML = "<a class=""TableRowButtonPlain"" href language=""jscript"" onclick=""BrwOpen("" & strUniqueID & "")"">+</a>"
-
- ' find the row that contains this item. To do this go up through parentElements and find the element whos zzType attribute is set
- Do Until IsNull(theItem)
- iType = theItem.getAttribute("zzType")
- if Not IsNull(iType) then
- Exit Do
- end if
- Set theParentItem = theItem.parentElement
- Set theItem = nothing
- Set theItem = theParentItem
- Set theParentItem = nothing
- Loop
- iRowIndex = theItem.rowIndex
- if (iType = 4) then
- theItem.cells(1).rowSpan = 1 ' so the description will wrap
- End if
- Set theItem = nothing
-
- if (iType > 9) then
- Set theTable = document.all.item("PackBrowseTableTable")
- else
- Set theTable = document.all.item("browseTableTable")
- end if
-
- errorspan.style.display = "none"
- ' delete all the rows util we have a row of the same type or higher
- iNum = iRowIndex + 1
- iMax = theTable.rows.length
- Do While iNum < iMax
- iType2 = theTable.rows(iRowIndex+1).getAttribute("zzType")
- if (iType2 <= iType) then
- Exit Do
- End if
- theTable.deleteRow(iRowIndex+1)
- iNum = iNum + 1
- Loop
- Set theTable = nothing
- End Sub
-
-
- Function BrwAddSchemas(iRowIndex, strUniqueID)
- Dim strGuid
- Dim arrItems()
- Dim iMax
- Dim iNum
-
- ' the right 49 characters of the strUniqueID is the GUID
- strGuid = Right(strUniqueID, 49)
-
- Call findSchemaGuids(arrItems, strGuid)
- iMax = UBound(arrItems) - 1
- if iMax >= 20 then
- if (MsgBox(GetResString(70), vbYesNoCancel, GetResString(71)) <> vbYes) then
- BrwAddSchemas = "false"
- Exit Function
- end if
- end if
- For iNum = 0 to iMax
- Call getSchemaNameDesc(strName, strDesc, arrItems(iNum))
- strUniqueID = strUniqueID & arrItems(iNum) ' make a unique id by adding our GUID
- Call GenerateBrowseSchemaRowDyn(iRowIndex+1+iNum, strName, strDesc, arrItems(iNum), strUniqueID)
- Next
- BrwAddSchemas = "true"
- End Function
-
-
- Function BrwAddTables(iRowIndex, strUniqueID)
- Dim strGuid
- Dim arrItems()
- Dim iMax
- Dim iNum
-
- ' the right 49 characters of the strUniqueID is the GUID
- strGuid = Right(strUniqueID, 49)
-
- Call findTableGuids(arrItems, strGuid)
- iMax = UBound(arrItems) - 1
- if iMax >= 20 then
- if (MsgBox(GetResString(70), vbYesNoCancel, GetResString(71)) <> vbYes) then
- BrwAddTables = "false"
- Exit Function
- end if
- end if
- For iNum = 0 to iMax
- Call getTableNameDesc(strName, strDesc, arrItems(iNum))
- strUniqueID = strUniqueID & arrItems(iNum) ' make a unique id by adding our GUID
- Call GenerateBrowseTableRowDyn(iRowIndex+1+iNum, strName, strDesc, arrItems(iNum), strUniqueID)
- Next
- BrwAddTables = "true"
- End Function
-
-
- Function BrwAddColumns(iRowIndex, strUniqueID)
- Dim strGuid
- Dim arrItems()
- Dim iMax
- Dim iNum
-
- ' the right 49 characters of the strUniqueID is the GUID
- strGuid = Right(strUniqueID, 49)
-
- Call findColumnGuids(arrItems, strGuid)
- iMax = UBound(arrItems) - 1
- if iMax >= 20 then
- if (MsgBox(GetResString(70), vbYesNoCancel, GetResString(71)) <> vbYes) then
- BrwAddColumns = "false"
- Exit Function
- end if
- end if
- For iNum = 0 to iMax
- Call getColumnNameDesc(strName, strDesc, arrItems(iNum))
- strUniqueID = strUniqueID & arrItems(iNum) ' make a unique id by adding our GUID
- Call GenerateBrowseColumnRowDyn(iRowIndex+1+iNum, strName, strDesc, arrItems(iNum), strUniqueID)
- Next
- BrwAddColumns = "true"
- End Function
-
-
- Function BrwAddColumnData(iRowIndex, strUniqueID)
- Dim arrColDataValues()
- Dim strGuid
-
- ' the right 49 characters of the strUniqueID is the GUID
- strGuid = Right(strUniqueID, 49)
-
- Call getColumnProps(arrColDataValues, strGuid)
- Call GenerateBrowseColumnDataRowDyn(iRowIndex+1, arrColDataValues, strGuid)
- BrwAddColumnData = "true"
- End Function
-